package com.qzsoft.zhjd.monitoring.modules.videomonitor.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ClassName VideoMonitorEntity
 * @Description 视频监控对象
 * @author linhuawei
 * @since 2022-03-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("n_video_monitor")
public class VideoMonitorEntity {

    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    private String type;

    @NotBlank(message = "监控名称不可为空")
    @Length(max = 20, message = "监控名称不可超过{max}个字")
    private String name;

    @NotBlank(message = "流应用名不可为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{2,20}$", message = "流应用名必须位2~20位数字、字母或数字字母组合")
    private String app;

    @NotBlank(message = "流ID不可为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{2,20}$", message = "流ID必须位2~20位数字、字母或数字字母组合")
    private String stream;

    @NotBlank(message = "视频地址不可为空")
    private String url;

    private Integer enable;

    private Integer enableHls;

    private Integer enableMp4;

    private String srcUrl;

    private String dstUrl;

    private Long timeoutMs;

    @NotBlank(message = "所属基地不可为空")
    private String baseCode;

    @NotBlank(message = "视频分组不可为空")
    private String groupCode;

    @NotBlank(message = "监控位置不可为空")
    private String resourceId;

    @NotBlank(message = "监控分类不可为空")
    private String resourceType;

}
